  <table>
  <?php foreach($tests as $dir=>$dirTests): ?>
    <tr>
      <td colspan=7 class='test-list-dir' id='test-list-item-dir-<?php echo $dir ?>'> <b>:::<?php echo $dir ?></b> </td>
    </tr>
    <tr class='test-list-headings'>
        <th><a title='name'>class/method</a></th>
        <th><a title='result'>res</a></th>
        <th><a title='days from when test was created on this system'>cre</a></th>
        <th><a title='days from the last result import time'>imp</a></th>
        <th><a title='time spent running test'>time</a></th>
        <th><a title='number of tasks related to this test'>tsks</a></th>
        <th><a title='exists on the filesystem?'>ex</a></th>
    </tr>
  <?php foreach($dirTests as $class=>$tests): ?>
    <tr>
      <td colspan=7 class='test-list-category'> <?php echo $class ?> </td>
    </tr>
    <?php $extraClass = '2'; ?>
    <?php foreach($tests as $test): ?>
    <?php $extraClass = (isset($extraClass) && $extraClass) ? '' : '2'; ?>
    <tr class='test-list-item<?php echo $extraClass; ?>'>
      <?php $resultAttributes = $test['result_attributes']; ?>
      <td class='test-list-title' id='test-list-item-<?php echo $test['id'] ?>' testId='<?php echo $test['id'] ?>'>
        <a onclick='tests.tests.showTest({id:<?php echo $test['id'] ?>})'>
        <?php echo $test['method'] ?>
        </a>
      </td>
      <td class='test-<?php echo $test['result'] ?>'>
          <?php if($test['result'] !== TestResult::SUCCESS): ?><script>tests.list.addTestWithError(<?php echo $test['id'] ?>)</script><?php endif; ?>&nbsp;&nbsp;&nbsp;&nbsp;
      </td>
      <td class='test-date'>
         <?php echo GraduaDate::daysOld($test['test_last_import_time']) ?>
      </td>
      <td class='test-days-old <?php if(Test::tooOld($test['result_last_import_time'])): ?>alert<?php endif; ?>'>
         <?php echo GraduaDate::daysOld($test['result_last_import_time'],1) ?>
      </td>
      <td class='test-days-old'>
         <?php echo number_format($resultAttributes['time'],2) ?>
      </td>
      <td class='test-days-old <?php if(!$test['numTasks']): ?>alert<?php endif; ?>'>
         <?php echo $test['numTasks'] ?>
      </td>
      <td class='test-days-old <?php if(!$test['fileExists']): ?>alert<?php endif; ?>'>
         <?php echo $test['fileExists'] ? 'Y' : 'N' ?>
      </td>
    </tr>
    <?php endforeach; ?>
  <?php endforeach; ?>
  <?php endforeach; ?>
  </table>